package com.hpin.mlxteacher.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by Aaron on 16/3/21.
 */
public class MqttServiceBean implements Parcelable {

    public String ip;
    public String port;
    public int code;
    public String code_msg;
    public List<TopicBean> topicList;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.ip);
        dest.writeString(this.port);
        dest.writeInt(this.code);
        dest.writeString(this.code_msg);
        dest.writeTypedList(topicList);
    }

    public MqttServiceBean() {
    }

    protected MqttServiceBean(Parcel in) {
        this.ip = in.readString();
        this.port = in.readString();
        this.code = in.readInt();
        this.code_msg = in.readString();
        this.topicList = in.createTypedArrayList(TopicBean.CREATOR);
    }

    public static final Creator<MqttServiceBean> CREATOR = new Creator<MqttServiceBean>() {
        public MqttServiceBean createFromParcel(Parcel source) {
            return new MqttServiceBean(source);
        }

        public MqttServiceBean[] newArray(int size) {
            return new MqttServiceBean[size];
        }
    };
}
